import axios from 'axios';

/**
 * 销售订单
 */
export class SaleOrderService {
  // 分页查询列表
  static findSaleOrders(queryParams) {
    return axios({
      url: '/restaurant/sale/SaleOrder/findSaleOrders',
      method: 'POST',
      data: queryParams
    });
  }

  //根据ID查询指定的销售订单
  static findSaleOrder(saleOrderId) {
    const query = {
      saleOrderId
    }
    return axios({
      url: '/restaurant/sale/SaleOrder/findSaleOrder',
      method: 'POST',
      params: query,
    });
  }

  //根据ID查询指定的销售订单(包含外键名称)
  static findSaleOrderForView(saleOrderId) {
    const query = {
      saleOrderId
    }
    return axios({
      url: '/restaurant/sale/SaleOrder/findSaleOrderForView',
      method: 'POST',
      params: query,
    });
  }

  //根据ID查询指定的销售订单(包含外键名称)
  static findSaleOrderForEdit(saleOrderId) {
    const query = {
      saleOrderId
    }
    return axios({
      url: '/restaurant/sale/SaleOrder/findSaleOrderForEdit',
      method: 'POST',
      params: query,
    });
  }

  //根据ID查询指定的销售订单(只提取ID 和 Name)
  static findSaleOrdersWithIdNameById(saleOrderId) {
    const query = {
      saleOrderId
    }
    return axios({
      url: '/restaurant/sale/SaleOrder/findSaleOrdersWithIdNameById',
      method: 'POST',
      params: query,
    });
  }

  //根据名称查询销售订单集合(只提取ID 和 Name)
  static findSaleOrdersWithIdNameByName(saleOrderName) {
    const query = {
      saleOrderName
    }
    return axios({
      url: '/restaurant/sale/SaleOrder/findSaleOrdersWithIdNameByName',
      method: 'POST',
      params: query,
    });
  }

  //新增保存销售订单
  static saveSaleOrder(saleOrder) {
    const query = {}
    return axios({
      url: '/restaurant/sale/SaleOrder/saveSaleOrder',
      method: 'POST',
      params: query,
      data: saleOrder
    });
  }

  //修改保存销售订单
  static updateSaleOrder(saleOrder) {
    const query = {}
    return axios({
      url: '/restaurant/sale/SaleOrder/updateSaleOrder',
      method: 'POST',
      params: query,
      data: saleOrder
    });
  }

  //根据ID查询指定的销售订单(只提取ID 和 Name)
  static deleteSaleOrder(saleOrderId) {
    const query = {
      saleOrderId
    }
    return axios({
      url: '/restaurant/sale/SaleOrder/deleteSaleOrder',
      method: 'POST',
      params: query,
    });
  }

  static changeOrderMenu(changeMenuRecordDto) {
    const query = {

    }
    return axios({
      url: '/restaurant/sale/SaleOrder/changeOrderMenu',
      method: 'POST',
      params: query,
      data: changeMenuRecordDto
    });
  }
}
